gtk4.git
9 years agobuiltinicon: avoid calculating font-metrics in vast majority of cases
Christian Hergert [Mon, 25 Apr 2016 07:22:54 +0000 (00:22 -0700)]
builtinicon: avoid calculating font-metrics in vast majority of cases

We perform lots of gadget allocations that require allocating a
GtkBuiltinIcon. One notable example is the scrollbar for a scrolled
window.

In the process of doing this, we often calculate baseline information that
isn't necessary. With how much this code path gets exercised, its worth
catching the result for the common case, which is that the font-description
has not changed and we are using the default language the application
was started with.

This simply caches the previous result and verifies that we can reuse it
with pango_font_description_hash() and a simple language check.

Numbers below are scrolling through a textview with GDK_KEY_Down.

Before:
      SELF CUMULATIVE    FUNCTION
[   0.08%] [   9.26%]    gtk_builtin_icon_get_preferred_size
[   0.01%] [   8.82%]      pango_context_get_metrics
[   0.02%] [   0.16%]      gtk_widget_get_pango_context
[   0.06%] [   0.06%]      pango_context_get_language
[   0.01%] [   0.02%]      g_type_check_instance_cast
[   0.02%] [   0.02%]      strlen
[   0.02%] [   0.02%]      pango_context_get_font_description
[   0.02%] [   0.02%]      g_list_foreach
[   0.01%] [   0.01%]      gtk_css_style_get_value
[   0.01%] [   0.01%]      itemize_with_font
[   0.01%] [   0.01%]      pango_context_get_type
[   0.01%] [   0.01%]      get_base_metrics
[   0.00%] [   0.01%]      pango_font_metrics_unref
[   0.01%] [   0.01%]      g_list_free
[   0.01%] [   0.01%]      gtk_builtin_icon_get_type

After:
      SELF CUMULATIVE    FUNCTION
[   0.08%] [   0.18%]    gtk_builtin_icon_get_preferred_size
[   0.02%] [   0.02%]      pango_font_description_hash
[   0.00%] [   0.02%]      gtk_widget_get_pango_context
[   0.00%] [   0.02%]        g_object_get_qdata
[   0.00%] [   0.02%]          g_datalist_id_get_data
[   0.02%] [   0.02%]      gtk_builtin_icon_get_type
[   0.01%] [   0.01%]      pango_context_get_font_description
[   0.00%] [   0.01%]      - - kernel - -
[   0.01%] [   0.01%]      pango_context_get_language
[   0.00%] [   0.01%]      gtk_css_style_get_value
[   0.00%] [   0.01%]      gtk_css_gadget_get_style

https://bugzilla.gnome.org/show_bug.cgi?id=765486

9 years agodocs: Add new GtkGLArea symbols
Emmanuele Bassi [Sat, 23 Apr 2016 09:34:53 +0000 (10:34 +0100)]
docs: Add new GtkGLArea symbols

9 years agodocs: Add new GdkGLContext symbols
Emmanuele Bassi [Sat, 23 Apr 2016 09:34:14 +0000 (10:34 +0100)]
docs: Add new GdkGLContext symbols

9 years agodocs: Clarify the platform-dependency of GdkGLContext:use-es
Emmanuele Bassi [Sat, 23 Apr 2016 09:33:08 +0000 (10:33 +0100)]
docs: Clarify the platform-dependency of GdkGLContext:use-es

Not all platforms allow creating an OpenGL ES context.

9 years agoglarea: Use the appropriate texture format for GLES
Emmanuele Bassi [Mon, 25 Apr 2016 11:28:41 +0000 (12:28 +0100)]
glarea: Use the appropriate texture format for GLES

The core OpenGL ES spec does not have GL_BGRA, so we need to make do
with GL_RGBA and live with the format conversion.

9 years agoglarea: Relay the use-es flag to context creation
Emanuele Aina [Mon, 18 Apr 2016 14:15:27 +0000 (16:15 +0200)]
glarea: Relay the use-es flag to context creation

https://bugzilla.gnome.org/show_bug.cgi?id=743746

9 years agodemo: Add GLES support to the GtkGLArea demo
Emmanuele Bassi [Sat, 23 Apr 2016 12:46:05 +0000 (13:46 +0100)]
demo: Add GLES support to the GtkGLArea demo

We need new shaders, and we need to select the correct shader when
building the program we use to render the triangle.

9 years agotests: Add GLES support to GtkGears
Emmanuele Bassi [Sat, 23 Apr 2016 11:31:15 +0000 (12:31 +0100)]
tests: Add GLES support to GtkGears

Use the appropriate GLSL shaders when running under an OpenGL ES
context.

9 years agotests: Add GLES shaders to testglarea
Emmanuele Bassi [Fri, 22 Apr 2016 12:53:16 +0000 (13:53 +0100)]
tests: Add GLES shaders to testglarea

Check if the GdkGLContext is using ES, and load the appropriate shaders
in that case.

9 years agogl: Use a uniform to flip R and B colors on GLES
Emmanuele Bassi [Mon, 25 Apr 2016 12:38:22 +0000 (13:38 +0100)]
gl: Use a uniform to flip R and B colors on GLES

This allows us to decide when the R and B color channels should be
flipped with a much better granularity.

For instance, when using GLX_EXT_texture_from_pixmap to create a GL
texture from a surface we don't need to swap the R and B channels, as
the internal representation of the texture data will already have the
appropriate colors.

We also don't need to flip color channels when blitting from a texture.

9 years agogl: Add fallback for missing subimage unpacking
Emmanuele Bassi [Mon, 25 Apr 2016 09:31:51 +0000 (10:31 +0100)]
gl: Add fallback for missing subimage unpacking

For GLES 2.0 platforms with the subimage unpacking extension we need to
upload one row of the image surface at a time.

9 years agox11: Allow creating GLES contexts
Emmanuele Bassi [Fri, 22 Apr 2016 17:01:19 +0000 (18:01 +0100)]
x11: Allow creating GLES contexts

We need to check for the GLX_EXT_create_context_es2_profile extension,
which allows us to create a GLES context while using the GLX API.

9 years agowayland: Bind the appropriate OpenGL API
Emmanuele Bassi [Sat, 23 Apr 2016 09:13:39 +0000 (10:13 +0100)]
wayland: Bind the appropriate OpenGL API

If we want to use OpenGL ES with EGL then we need to bind the API before
creating the EGL context.

9 years agowayland: Add debugging notes for EGL context creation
Emmanuele Bassi [Fri, 22 Apr 2016 17:50:50 +0000 (18:50 +0100)]
wayland: Add debugging notes for EGL context creation

9 years agowayland: Honour GDK_GL=gles on context creation
Emmanuele Bassi [Fri, 22 Apr 2016 11:45:32 +0000 (12:45 +0100)]
wayland: Honour GDK_GL=gles on context creation

9 years agowayland: Implement asking for a GLES context
Emmanuele Bassi [Mon, 18 Apr 2016 09:13:05 +0000 (10:13 +0100)]
wayland: Implement asking for a GLES context

Wayland uses EGL, which allows us to ask for a GLES context.

https://bugzilla.gnome.org/show_bug.cgi?id=743746

9 years agogl: Tweak the swizzle for GLES texture fragments
Emmanuele Bassi [Sat, 23 Apr 2016 12:52:03 +0000 (13:52 +0100)]
gl: Tweak the swizzle for GLES texture fragments

Cairo surfaces are in BGRA format, but we upload them as RGBA buffers on
GLES; this means that the R and B channels are flipped in the texture
data.

Instead of doing a costly channel flip before putting them on the GPU,
we can flip the values inside the GLSL shader we use specifically for
GLES.

9 years agogl: Use the appropriate formats when reading buffers on GLES
Emmanuele Bassi [Sat, 23 Apr 2016 11:16:03 +0000 (12:16 +0100)]
gl: Use the appropriate formats when reading buffers on GLES

We cannot use GL_BGRA and GL_UNSIGNED_INT_8_8_8_8_REV when reading back
from the frame buffer in the software fallback path, as they do not
exist on OpenGL ES.

This will make the slow path a bit slower, because of the implicit
format conversion.

9 years agogl: Use the appropriate format on GLES
Emmanuele Bassi [Sat, 23 Apr 2016 09:21:13 +0000 (10:21 +0100)]
gl: Use the appropriate format on GLES

When uploading a Cairo image surface to a GL texture we cannot use
GL_BGRA and GL_UNSIGNED_INT_8_8_8_8_REV on OpenGL ES, as they do not
exist in the core spec.

9 years agogl: Add more OpenGL ES checks
Emmanuele Bassi [Fri, 22 Apr 2016 16:27:04 +0000 (17:27 +0100)]
gl: Add more OpenGL ES checks

Check for the appropriate extensions depending on which type of API
we're using.

9 years agogdk: Add GLES shaders
Emmanuele Bassi [Fri, 22 Apr 2016 12:52:49 +0000 (13:52 +0100)]
gdk: Add GLES shaders

We cannot use GL shaders with GLES.

9 years agogdk: Add 'GDK_GL=gles' flag
Emmanuele Bassi [Fri, 22 Apr 2016 11:40:57 +0000 (12:40 +0100)]
gdk: Add 'GDK_GL=gles' flag

Allows forcing the selection of a GLES context.

9 years agogdk: Move GLSL shaders into GResource
Emmanuele Bassi [Fri, 22 Apr 2016 11:34:33 +0000 (12:34 +0100)]
gdk: Move GLSL shaders into GResource

Having the shaders inlined as C strings makes them harder to edit and
maintain.

9 years agogl: Relay use-es from context to paint data
Emmanuele Bassi [Mon, 18 Apr 2016 09:21:36 +0000 (10:21 +0100)]
gl: Relay use-es from context to paint data

This way we can select the appropriate API or the appropriate shaders.

https://bugzilla.gnome.org/show_bug.cgi?id=743746

9 years agogl: Add 'use-es' flag
Emmanuele Bassi [Mon, 18 Apr 2016 09:10:30 +0000 (10:10 +0100)]
gl: Add 'use-es' flag

On some platforms we can ask the GL context machinery to create a GLES
context, instead of a GL one.

In order to ask for a GLES context at GdkGLContext realization time, we
use a bit field like we do for forward compatible, or debug contexts.

The 'use-es' bit also changes the way we select a default version,
because OpenGL and OpenGLES versions differ.

https://bugzilla.gnome.org/show_bug.cgi?id=743746

9 years agoinspector: do not leak seat capabilities descriprion
Paolo Borelli [Sun, 24 Apr 2016 09:46:38 +0000 (11:46 +0200)]
inspector: do not leak seat capabilities descriprion

Factor out an utility function for readability and free the string
with the list of capabilities

9 years agoquartz: fix quartz build
Christian Hergert [Sun, 24 Apr 2016 07:46:15 +0000 (00:46 -0700)]
quartz: fix quartz build

The quartz backend has its own implementation of these that
collide since the gtkdragdest.c extraction.

https://bugzilla.gnome.org/show_bug.cgi?id=764712

9 years agokineticscrolling: avoid stutter at tail of kinetic deceleration
Christian Hergert [Sun, 24 Apr 2016 09:41:26 +0000 (02:41 -0700)]
kineticscrolling: avoid stutter at tail of kinetic deceleration

When decelerating the kinetic scroll, we can get into a position where it
looks like we are stuttering. This happens because the amount we move is
so little that it takes multiple frames to make forward progress by one
pixel.

This prevents that by detecting when we have reached the slow stutter of
the deceleration and simply stops the deceleration phase immediately.

https://bugzilla.gnome.org/show_bug.cgi?id=765493

9 years agoAdwaita: color tweaks
Lapo Calamandrei [Fri, 22 Apr 2016 12:42:47 +0000 (14:42 +0200)]
Adwaita: color tweaks

use a slightly cold and slightly darker gray for the dark variant,
use the same hue for the osd bg color, make it bit darker and
transparent.

9 years agoUpdated Scottish Gaelic translation
GNOME Translation Robot [Fri, 22 Apr 2016 12:09:51 +0000 (12:09 +0000)]
Updated Scottish Gaelic translation

9 years agoapp: replace private accels functions by get_application_accels()
Sébastien Wilmet [Wed, 20 Apr 2016 15:24:46 +0000 (17:24 +0200)]
app: replace private accels functions by get_application_accels()

It's like gtk_application_get_action_muxer().

https://bugzilla.gnome.org/show_bug.cgi?id=764879

9 years agoapp: share function to normalise detailed action name
Sébastien Wilmet [Wed, 20 Apr 2016 15:13:26 +0000 (17:13 +0200)]
app: share function to normalise detailed action name

Put the function in gtkactionmuxer.c, where
gtk_print_action_and_target() is implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=764879

9 years agoapp-accels: rename static functions
Sébastien Wilmet [Wed, 20 Apr 2016 15:03:36 +0000 (17:03 +0200)]
app-accels: rename static functions

Remove the "accels_" prefix from the remaining static functions. The
prefix no longer makes sense since the whole file is devoted to accels.

https://bugzilla.gnome.org/show_bug.cgi?id=764879

9 years agoapp: extract GtkApplicationAccels private class
Sébastien Wilmet [Mon, 11 Apr 2016 15:13:09 +0000 (17:13 +0200)]
app: extract GtkApplicationAccels private class

This has several benefits:
- Less code in GtkApplication. The accels handling is something
  self-contained, and GtkApplication now delegates the work.
- For the accels functions, there is now a distinction between static
  functions and functions in the gtkapplicationaccelsprivate.h header,
  which makes the code easier to understand, because we have a good
  overview just by reading the header.
- The struct _GtkApplicationPrivate is now easier to find instead of
  being in the middle of the file.

https://bugzilla.gnome.org/show_bug.cgi?id=764879

9 years agoapp: write higher-level gtk_application_accels static functions
Sébastien Wilmet [Mon, 11 Apr 2016 15:28:23 +0000 (17:28 +0200)]
app: write higher-level gtk_application_accels static functions

These will become the functions present in the
gtkapplicationaccelsprivate.h header.

The gtk_application_accels functions deal with detailed_action_name's
instead of action_and_target's. action_and_target is an implementation
detail of Accels.

The added function prototype is temporary, it'll be removed in a later
commit.

https://bugzilla.gnome.org/show_bug.cgi?id=764879

9 years agotextiter: add unit test for forward_to_line_end
Paolo Borelli [Thu, 21 Apr 2016 20:54:55 +0000 (22:54 +0200)]
textiter: add unit test for forward_to_line_end

Surprisingly we had no unit test for this method

9 years agoFix formatting
Matthias Clasen [Fri, 22 Apr 2016 03:24:13 +0000 (23:24 -0400)]
Fix formatting

The previous change was not quite using the right coding style.

9 years agolistbox: Make sure page down/up move at least one row
Timm Bäder [Tue, 19 Apr 2016 15:12:00 +0000 (17:12 +0200)]
listbox: Make sure page down/up move at least one row

When the current cursor_row is taller than the page_size we get from the
GtkAdjustment, the previous code would not actually cause any scrolling,
so make sure we just take the row after or before the cursor_row in that
case.

https://bugzilla.gnome.org/show_bug.cgi?id=765261

9 years agoAd d new API to the docs
Matthias Clasen [Fri, 22 Apr 2016 02:55:57 +0000 (22:55 -0400)]
Ad d new API to the docs

9 years agoSave scancode inside GdkEventPrivate
Frediano Ziglio [Thu, 21 Apr 2016 13:30:58 +0000 (14:30 +0100)]
Save scancode inside GdkEventPrivate

Windows save in hardware_keycode an information which is not so low
level and some application require the hardware scancode.
As Windows provides this information save it in GdkEventPrivate
and provide a function to get this information.
For no Windows system the function return the hardware_keycode instead.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
https://bugzilla.gnome.org/show_bug.cgi?id=765259

9 years agocssshadowsvalue: Avoid allocating new value if not needed
Benjamin Otte [Thu, 21 Apr 2016 20:28:58 +0000 (22:28 +0200)]
cssshadowsvalue: Avoid allocating new value if not needed

9 years agocssbordervalue: Avoid allocating new value if not needed
Benjamin Otte [Thu, 21 Apr 2016 20:28:40 +0000 (22:28 +0200)]
cssbordervalue: Avoid allocating new value if not needed

9 years agocssbgsizevalue: Avoid allocating new value if not needed
Benjamin Otte [Thu, 21 Apr 2016 20:28:14 +0000 (22:28 +0200)]
cssbgsizevalue: Avoid allocating new value if not needed

9 years agoAdd a dnd test using a window as icon
Matthias Clasen [Thu, 21 Apr 2016 18:21:14 +0000 (14:21 -0400)]
Add a dnd test using a window as icon

This case is causing problems in firefox. Lets at least make
sure that it doesn't crash in GTK+.

9 years agoAdwaita: backdrop active button color tweaks
Lapo Calamandrei [Thu, 21 Apr 2016 15:01:45 +0000 (17:01 +0200)]
Adwaita: backdrop active button color tweaks

9 years agoAdwaita: cosmetics
Lapo Calamandrei [Thu, 21 Apr 2016 14:51:24 +0000 (16:51 +0200)]
Adwaita: cosmetics

9 years agoAdwaita: solid bg for disabled pushed button
Lapo Calamandrei [Thu, 21 Apr 2016 14:43:35 +0000 (16:43 +0200)]
Adwaita: solid bg for disabled pushed button

9 years agoAdwaita: spinbutton fixes
Lapo Calamandrei [Thu, 21 Apr 2016 14:25:05 +0000 (16:25 +0200)]
Adwaita: spinbutton fixes

reset background-color on backdrop disable buttons and entry node.

9 years agogtkmenusectionbox: remove submenus when the parent item is removed
Jonathan Matthew [Wed, 9 Mar 2016 12:44:45 +0000 (22:44 +1000)]
gtkmenusectionbox: remove submenus when the parent item is removed

https://bugzilla.gnome.org/show_bug.cgi?id=749405

9 years agowidget: Don't show widget resizes in the inspector
Matthias Clasen [Wed, 20 Apr 2016 03:32:26 +0000 (23:32 -0400)]
widget: Don't show widget resizes in the inspector

Avoiding this sort of visual debugging in the inspector
is the main reason we have per-display debug flags now.

9 years agocss gadget: Fix baseline debug
Matthias Clasen [Wed, 20 Apr 2016 03:24:54 +0000 (23:24 -0400)]
css gadget: Fix baseline debug

We were not using the baseline that we're computing.

9 years agoUse qdata for debug flags
Matthias Clasen [Wed, 20 Apr 2016 03:23:59 +0000 (23:23 -0400)]
Use qdata for debug flags

This avoids some overhead.

9 years agocss gadget: Don't get display flags twice
Matthias Clasen [Wed, 20 Apr 2016 03:23:18 +0000 (23:23 -0400)]
css gadget: Don't get display flags twice

This got more expensive now that we store them per-display,
so don't get them twice in the same function.

9 years agodebug: remove open-coded debug checks in gtktextsegment
Christian Hergert [Wed, 20 Apr 2016 02:35:52 +0000 (19:35 -0700)]
debug: remove open-coded debug checks in gtktextsegment

These runtime checks were being performed whether or not we were in a
debug build. Using GTK_DEBUG_CHECK() will compile out of production
builds, as it will result in something like:

  if (G_UNLIKELY(0))

which the optimizer can prune.

https://bugzilla.gnome.org/show_bug.cgi?id=765284

9 years agotext tag: Add a va marshaller to ::event
Matthias Clasen [Wed, 20 Apr 2016 01:09:51 +0000 (21:09 -0400)]
text tag: Add a va marshaller to ::event

9 years agotext buffer: Add va marshallers for signals
Matthias Clasen [Wed, 20 Apr 2016 01:00:57 +0000 (21:00 -0400)]
text buffer: Add va marshallers for signals

9 years agomenushell: Add a va marshaller for ::insert
Matthias Clasen [Wed, 20 Apr 2016 01:00:20 +0000 (21:00 -0400)]
menushell: Add a va marshaller for ::insert

9 years agoAdwaita: use an image for backdrop button background
Lapo Calamandrei [Tue, 19 Apr 2016 21:00:54 +0000 (23:00 +0200)]
Adwaita: use an image for backdrop button background

which doesn't make the sliders flash during background transition.

9 years agoAdwaita: link button style fix
Lapo Calamandrei [Tue, 19 Apr 2016 20:57:28 +0000 (22:57 +0200)]
Adwaita: link button style fix

ensure the label color doesn't get overridden, fixes link button
label being gray in backdrop.

9 years agoAdwaita: scale with marks style fix
Lapo Calamandrei [Tue, 19 Apr 2016 20:55:55 +0000 (22:55 +0200)]
Adwaita: scale with marks style fix

reset background-color on the slider.

9 years agoAdwaita: fix switch styling
Lapo Calamandrei [Tue, 19 Apr 2016 20:45:05 +0000 (22:45 +0200)]
Adwaita: fix switch styling

ensure the last button has rounded corners and adapt to button
mixin changes.

9 years agoAdwaita: fix insensitive switch styling
Lapo Calamandrei [Tue, 19 Apr 2016 20:08:31 +0000 (22:08 +0200)]
Adwaita: fix insensitive switch styling

misplaced backdrop disabled selector was overriding the disabled
one.

9 years agoAdd some va marshallers to frequent signals
Matthias Clasen [Tue, 19 Apr 2016 20:11:10 +0000 (16:11 -0400)]
Add some va marshallers to frequent signals

This makes us take the fast path in signal emission.

9 years agoAdwaita: stop using images for solid backgrounds...
Lapo Calamandrei [Tue, 19 Apr 2016 19:58:24 +0000 (21:58 +0200)]
Adwaita: stop using images for solid backgrounds...

...unless it's needed.

9 years agomagnifier: Only connect to ::draw when needed
Matthias Clasen [Tue, 19 Apr 2016 19:27:08 +0000 (15:27 -0400)]
magnifier: Only connect to ::draw when needed

This making us take the slow path in ::draw handling, so we
want to avoid it if we can.

https://bugzilla.gnome.org/show_bug.cgi?id=765238

9 years agoAdwaita: add shadows back...
Lapo Calamandrei [Tue, 19 Apr 2016 19:24:37 +0000 (21:24 +0200)]
Adwaita: add shadows back...

...correctly inizializing a sass var.

9 years agowayland: Leave existing mods on map_virtual_modifiers
Rui Matos [Tue, 19 Apr 2016 19:03:45 +0000 (21:03 +0200)]
wayland: Leave existing mods on map_virtual_modifiers

map_virtual_modifiers() is supposed to add the necessary virtual mods
but otherwise leave the mods that are passed in.

https://bugzilla.gnome.org/show_bug.cgi?id=765270

9 years agowayland: Some more debug spew
Matthias Clasen [Tue, 19 Apr 2016 16:43:03 +0000 (12:43 -0400)]
wayland: Some more debug spew

Print the modifiers and their mapping out as well. This
information is contained in the keymap, but this is a bit
easier to digest.

9 years agowayland: Add debug output for keymaps
Matthias Clasen [Tue, 19 Apr 2016 16:23:51 +0000 (12:23 -0400)]
wayland: Add debug output for keymaps

Use GDK_DEBUG=input to see your keymap sent over and over again.
Efficiency!

9 years agogtkcssimagebuiltin: Save/restore around cairo_clip
Timm Bäder [Tue, 19 Apr 2016 13:20:14 +0000 (15:20 +0200)]
gtkcssimagebuiltin: Save/restore around cairo_clip

This was previously causing trouble in checkbuttons where the check node
didn't have an icon shadow set, e.g. in Raleigh.

9 years agoAdd a comment to explain numbers here
Matthias Clasen [Tue, 19 Apr 2016 11:34:44 +0000 (07:34 -0400)]
Add a comment to explain numbers here

This explains the change in the previous commit.

9 years agocups: Fix duplicate string
Piotr Drąg [Sat, 16 Apr 2016 17:46:02 +0000 (19:46 +0200)]
cups: Fix duplicate string

https://bugzilla.gnome.org/show_bug.cgi?id=765122

9 years agoMSVC builds: Update how introspection builds are done
Chun-wei Fan [Tue, 8 Sep 2015 06:14:46 +0000 (14:14 +0800)]
MSVC builds: Update how introspection builds are done

This first adds a common autotools module that can be included by
the Makefile.am's to generate the file lists and the g-ir-scanner/
g-ir-compiler command lines to build the introspection files.

The autotools files for gdk/ and gtk/ are then updated to generate
the full file lists needed to build the introspection files, with
the full command lines for g-ir-scanner and g-ir-compiler as NMake
Makefile modules that can be used to build the introspection files
for Visual Studio builds.

https://bugzilla.gnome.org/show_bug.cgi?id=765195

9 years agoAdwaita: better shadow stacking mixin
Lapo Calamandrei [Mon, 18 Apr 2016 23:18:34 +0000 (01:18 +0200)]
Adwaita: better shadow stacking mixin

9 years agoframe-clock: avoid g_signal_emit_by_name()
Christian Hergert [Mon, 18 Apr 2016 21:16:20 +0000 (14:16 -0700)]
frame-clock: avoid g_signal_emit_by_name()

These were showing up higher in Sysprof profiles.

The simple fix is to avoid the emit_by_name() and let the interface emit
the signals directly. No function preconditions are provided since these
are internal API.

9 years agoAdwaita: fix infobar text color in backdrop windows
Lapo Calamandrei [Mon, 18 Apr 2016 22:11:09 +0000 (00:11 +0200)]
Adwaita: fix infobar text color in backdrop windows

see https://bugzilla.gnome.org/show_bug.cgi?id=765213

9 years agofont button: Convert from pango to css properly
Matthias Clasen [Mon, 18 Apr 2016 19:04:37 +0000 (15:04 -0400)]
font button: Convert from pango to css properly

This utility function should probably find a home somewhere else.
For now, this makes the deprecation warning go away.

9 years agocssimage: Warn if gradients only have 1 color stop
Benjamin Otte [Mon, 18 Apr 2016 18:25:11 +0000 (20:25 +0200)]
cssimage: Warn if gradients only have 1 color stop

GTK <= 3.20 allowed that but the CSS spec and borwsers do not.
We might want to just remove that feature, but for now, we just warn.

9 years agotheme: linear-gradient() needs 2 color-stops
Benjamin Otte [Sun, 27 Mar 2016 23:50:32 +0000 (01:50 +0200)]
theme: linear-gradient() needs 2 color-stops

So make sure our _solid() function gives it two.

9 years agotheme: Split out _solid() function
Benjamin Otte [Sun, 27 Mar 2016 17:41:19 +0000 (19:41 +0200)]
theme: Split out _solid() function

The function creates a solid color image. Currently this is done with
linear-gradient().

9 years agowin32 theme: Fix functions to not have spaces
Benjamin Otte [Sun, 3 Apr 2016 01:39:46 +0000 (03:39 +0200)]
win32 theme: Fix functions to not have spaces

CSS doesn't allow that (although GTK's CSS parser did so far not
complain).

9 years agoExpand css style font tests
Matthias Clasen [Mon, 18 Apr 2016 18:38:53 +0000 (14:38 -0400)]
Expand css style font tests

Test more of the syntax of the font: shorthand.

9 years agoFix a typo
Matthias Clasen [Mon, 18 Apr 2016 18:38:12 +0000 (14:38 -0400)]
Fix a typo

We don't want to parse a weight twice, but a weight and a stretch.

9 years agoHighContrast: Fix font: usage
Matthias Clasen [Mon, 18 Apr 2016 18:17:55 +0000 (14:17 -0400)]
HighContrast: Fix font: usage

9 years agoAdd backwards compat back
Matthias Clasen [Mon, 18 Apr 2016 18:09:41 +0000 (14:09 -0400)]
Add backwards compat back

Apparently, there's lots of font: "pango font description" out there,
so keep parsing this, with a deprecation warning.

9 years agoAdwaita: Fix use of font: shorthand
Matthias Clasen [Mon, 18 Apr 2016 15:45:55 +0000 (11:45 -0400)]
Adwaita: Fix use of font: shorthand

9 years agoFix parsing of the font: shorthand
Matthias Clasen [Mon, 18 Apr 2016 15:43:29 +0000 (11:43 -0400)]
Fix parsing of the font: shorthand

Our code here was just throwing it at PangoFontDescription.
Fix this by parsing the various components ourselves.

9 years agoExport some font parsing functions
Matthias Clasen [Mon, 18 Apr 2016 15:43:01 +0000 (11:43 -0400)]
Export some font parsing functions

These will be used for parsing the font: shorthand too.

9 years agoFix the css style font test
Matthias Clasen [Mon, 18 Apr 2016 15:40:10 +0000 (11:40 -0400)]
Fix the css style font test

Setting the font: shorthand to something like smaller is not
in line with the css spec. Just set the font-size: property
for this.

Also fix the other font: shorthand to specify size and family
according to the css spec.

9 years agocss style: Rename some static functions
Matthias Clasen [Mon, 18 Apr 2016 13:43:10 +0000 (09:43 -0400)]
css style: Rename some static functions

Make the font property functions follow the general naming
scheme, and remove pango from the names.

9 years agoAdd docs for new API
Matthias Clasen [Mon, 18 Apr 2016 13:42:40 +0000 (09:42 -0400)]
Add docs for new API

9 years agowayland: Improve checks when flushing scroll events
Carlos Garnacho [Mon, 18 Apr 2016 13:10:49 +0000 (14:10 +0100)]
wayland: Improve checks when flushing scroll events

If we get gdk_wayland_seat_flush_frame_event() with no previous event to be
flushed, we fallback into the scroll event checks. However, there's no check
performed there as to whether it really scrolled, so it'd always send a smooth
scroll event with 0/0 deltas in this case.

This should be mostly harmless, but still, we should only end up emitting scroll
events if those really happened.

9 years agowayland: Do not check the pointer focus when receiving wl_pointer.frame
Carlos Garnacho [Mon, 18 Apr 2016 12:10:24 +0000 (13:10 +0100)]
wayland: Do not check the pointer focus when receiving wl_pointer.frame

The frame event is also meant to compress wl_pointer.leave events, at this
point the focus surface will be definitely NULL. In the end, wl_pointer.frame
should flush the last composed event despite the pointer focus.

https://bugzilla.gnome.org/show_bug.cgi?id=765065

9 years agogdk: Make GDK_TOUCH_CANCEL be dealt with similarly to GDK_TOUCH_END
Carlos Garnacho [Sun, 17 Apr 2016 20:19:58 +0000 (21:19 +0100)]
gdk: Make GDK_TOUCH_CANCEL be dealt with similarly to GDK_TOUCH_END

We must emit the cancel event with the same semantics, and towards the GdkWindow
that is currently under the touchpoint, so make proxy_button_event() deal with
GDK_TOUCH_CANCEL.

Fixes the GDK_TOUCH_CANCEL event being emitted only on the toplevel, which is
usually non-sufficient.

9 years agowidget: Use gdk_pango_get_for_display
Matthias Clasen [Fri, 1 Apr 2016 01:35:43 +0000 (21:35 -0400)]
widget: Use gdk_pango_get_for_display

9 years agoAdd gdk_pango_context_get_for_display
Matthias Clasen [Fri, 1 Apr 2016 01:33:03 +0000 (21:33 -0400)]
Add gdk_pango_context_get_for_display

This is the obvious 1 line equivalent of the for_screen function.

9 years agoUpdated Polish translation
Piotr Drąg [Mon, 18 Apr 2016 00:36:20 +0000 (02:36 +0200)]
Updated Polish translation

9 years agoAdwaita: cosmetics
Lapo Calamandrei [Sun, 17 Apr 2016 21:40:29 +0000 (23:40 +0200)]
Adwaita: cosmetics

9 years agoAdwaita: colorbutton colorswatch shadow fix
Lapo Calamandrei [Sun, 17 Apr 2016 21:08:26 +0000 (23:08 +0200)]
Adwaita: colorbutton colorswatch shadow fix

reset colorswatch box-shadow on active and checked state as well
following latest style changes.

9 years agoAdwaita: increase opacity on scale label and marks
Lapo Calamandrei [Sun, 17 Apr 2016 20:46:48 +0000 (22:46 +0200)]
Adwaita: increase opacity on scale label and marks

using the same opacity as dim-label.